package com.vehicle.auto.click.test;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class MyFirstTest2 {
    public static void main(String[] args) {
        System.out.println("start selenium");
        System.setProperty("webdriver.firefox.bin", "D:\\MySoft\\firefox\\firefox.exe");
        System.setProperty("webdriver.gecko.driver", "D:\\yankong_tool\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(8L, TimeUnit.SECONDS);
        driver.get("http://192.168.20.197:7000/#/v5");

        try {
            Thread.sleep(5000L);
        } catch (InterruptedException var10) {
            var10.printStackTrace();
        }

        driver.get("http://192.168.20.197:7000/#/v5");
        WebElement element = driver.findElement(By.cssSelector("#layout > section > header > div:nth-child(2) > a > i"));
        element.click();
        System.out.println(driver.getCurrentUrl());
        driver.navigate().back();
        System.out.println(driver.getCurrentUrl());
        WebElement element1 = driver.findElement(By.xpath("//*[@id=\"vehicle\"]/form/div[1]/div/div/div[1]/input"));
        Select select = new Select(element1);
        select.selectByVisibleText("号牌号码");
        WebElement element2 = driver.findElement(By.xpath("//*[@id=\"vehicle\"]/form/div[2]/div/div/input"));
        element2.sendKeys(new CharSequence[]{"LJY772"});
        WebElement element3 = driver.findElement(By.xpath("//*[@id=\"vehicle\"]/form/div[4]/div/div/input[1]"));
        element3.clear();
        WebElement element4 = driver.findElement(By.xpath("//*[@id=\"vehicle\"]/form/div[4]/div/div/input[2]"));
        element4.clear();
        WebElement element5 = driver.findElement(By.xpath("//*[@id=\"vehicle\"]/form/div[5]/div/button[1]"));
        element5.click();
        WebElement element6 = driver.findElement(By.xpath("//*[@id=\"tableData\"]/div[3]/table/tbody/tr/td[1]/div"));
        element6.click();
    }
}
